Getting started
What is Windows Grep?

Welcome to Windows Grep, the powerful text search utility for Microsoft Windows 95 and NT.

Windows Grep is a tool for searching files on your disks for occurrences of text strings that you specify. Although Windows 95 and many other programs have file searching capabilities built-in, none can match the power and versatility of Windows Grep.

In addition to searching, Windows Grep can also perform global replacing in your files, with complete safety.

Windows Grep is designed for searching plain-ASCII text files, such as program source, HTML, RTF and batch files. In addition you can search binary files such as word processor documents, databases, spreadsheets and executables.

The program has been in development since 1991 and this, version 2.0, is the 8th release. A number of features present in the 16 bit versions are not yet available in this first 32 bit release but it is hoped that, with your support, they soon will be.

For the latest news on Windows Grep, and to download the current version, visit the Windows Grep home page at:

http://www.pncl.co.uk/~huw/homepage.html

(Next…)


The main window layout

Windows Grep looks and behaves like any other Windows 95 program. For this reason there is really not much that needs saying about the main window.

At the very top of the window is the obligatory toolbar. All buttons have tooltips to indicate their function. Most, but not all, buttons have an equivalent menu command. Similarly, all commonly-used menu items have an equivalent toolbar button. Immediately below the toolbar is a couple of text boxes. The left one displays search results and the right one indicates the contents of the results window

The status bar at the bottom of the window is used to give more information about toolbar buttons and menu items and to display search progress information during searching.

The rest of the window is divided into 2 parts. By default these are one on top of the other.

The top half, the file list window, is filled during searching with a list of files containing matches. By default this is in a tabular format. It can be changed to an iconic view, like other Windows Explorer windows, by right-clicking on it and selecting one of the views listed in the View sub-menu. When in tabular view, the widths of the columns can be changed by dragging the separator bars left or right, and can be moved by dragging and dropping.

The bottom half of the main window is the results window. This is used to display matches once the search is completed, and replace reports. The appearance of this can be customised by accessing the menu activated when right-clicking on it.

By clicking on one of these buttons on the toolbar:

the file list window and results window can be toggled between one-on-top-of-the-other and side-by-side.

(Next…)


User level selection
Beginner or expert?

Are you an accomplished Windows Grep user or a beginner?

Windows Grep has two interface modes: Beginner and Expert. These are selected by choosing the appropriate item in the Options menu.

In beginner mode, the default, searching and replacing are carried out with the help of Assistants. The Search Assistant and Replace Assistant guide you through the task of entering information needed to perform a search or replace in the same way Microsoft Wizards guide you through complex Windows 95 tasks. Once you have used the program a few times and have a feel for how it works, you'll probably want to switch to expert mode.

In expert mode, the interface is much like that in the 16-bit versions of the program. If you have used Windows Grep before, you'll probably switch to expert mode straightaway.

With a few exceptions, all the program’s features are available in both beginner and expert modes. Choose the one that's right for you.

(Next…)


Grep

Grep is an UNIX acronym for Global Regular Expression Parser


Starting a search

There are several ways of starting a search:

 	By clicking on the search button, or selecting Search from the File menu.

If you are in beginner mode, the Search Assistant will be displayed which will guide you though the process of entering the information needed to start a search. If you are in expert mode, the search criteria dialog box will be displayed to enable you to enter your search criteria. Either way, once the necessary information has been entered and you press the Finish or OK button, the search will commence. This is the normal way to start a search.

See the Search Assistant and the search criteria dialog box for more information on searching.

 	By clicking on the start button, or selecting Start from the Search menu.

Pressing this button will restart the last search performed. Windows Grep remembers search criteria every time you perform a search and saves it to disk. The next time Windows Grep is run, it is re-loaded. Pressing this button as soon as you load Windows Grep will restart the last search you performed the last time you used the program.

By clicking on the search again button, or selecting Search files in list from the File menu.

Once you have performed a search, pressing this button will enable you to search the files in the list again, perhaps for a different string.

•	By specifying parameters on the command line

Windows Grep supports a command line interface similar to DOS or UNIX grep utilities. See Using the command line interface for more information.

•	By double-clicking on .PAR files in Windows Explorer

.PAR files contain Windows Grep search parameters. You can save your current search criteria to disk for future recall. Double-clicking on one in Windows will cause Windows Grep to load and run a search with the parameters found in the file. See Format of .PAR files for more information.

To stop a search at any time during its execution, press the stop button, or select Stop from the Search menu.


Searching using the Search Assistant
The Search Assistant

The search assistant will guide you through the process of entering the information required to perform a search.

As you work through the assistant, you will be asked four questions:

•	What text do you want to find?

Enter the text string that you want to locate in this box. This can be any combination of characters you like, including accented and other 'extended' characters. Some characters have a special meaning when performing a 'normal' search (The type of search you want to do is asked next). These are used to specify regular expressions. See the Regular expressions topic for more information.

•	What type of search do you want to perform?

Windows Grep supports three types of search, Normal, Soundex and Quick. Normal searches are just as they sound - text strings will be matched exactly, and regular expressions are supported. Soundex searches allow you to find words that sound like the one you specify. This is particularly useful for finding names which may have a variation in the spelling, such as Smith and Smythe or Robin, Robyn, Robbin, Rhobbyne and so on. The algorithm is not foolproof, however, so you may be surprised by some matches returned. Quick searches are marginally quicker that normal searches but do not support regular expressions or other options.

You can also elect to Match case and find Whole words only. These options do exactly as their name suggests, and are only available when performing normal searches. By definition, soundex works at a word-level.

•	What folders do you want to search?

Windows Grep can search entire hard disks or in particular folders. Navigate through the folders on the left-hand-side of the Assistant until you find the one you want to search, then press the > key to add it to the list of folders to search. You can specify more than one folder to search, and remove folders from the list to search by pressing the < button. Windows Grep can search in all folders within the selected folders by selecting the Search in subfolders option. For example, to search an entire hard disk, add c:\ to the list and select Search in subfolders.

•	What files you want to include in the search

Finally, the type of files that are searched can be specified. The left-hand list displays extensions of files that you may wish to include in your search. Select one from the list, then click on the > button to have files of that extension searched. If the type of files you want to search are not included in the list, you can enter a custom file specification in the box provided and add it to the include list. This specification can include normal DOS wildcard characters * and ? so can be ambiguous or unambiguous - i.e. can refer to multiple files (*.*) or a single file (myfile.txt).

Note that if you include overlapping file specifications, such as *.* and *.txt, files may be searched more than once. In this example, files of extension *.txt will be searched twice.


Searching using the search criteria dialog box
The search criteria dialog box

The search criteria dialog box has two pages: General and Filters

The General page allows you to specify general search parameters:

•	Search string

Enter the string to locate in this box. This can contain Regular expressions if a normal search is specified. A history of previous strings is available by pressing the drop-down arrow.

•	Normal, Quick or Soundex search

In a normal search strings are matched exactly, and may contain regular expressions. In a soundex search, a sounds-like algorithm is used. See the discussion in the Search Assistant topic for more information. Quick searches are marginally quicker than normal searches, and allow searches without regular expression interpretation to be performed with ease. Quick searches are case-insensitive.

•	Whole words only

Available only when conducting normal searches, this controls whether matches must be whole words or whether they can be parts of words. Obviously searching for non-alphanumeric characters when specifying this option will not return the desired results.

•	Match case

Again, available only for normal searches, this controls whether matches have to match the case or the search string or not.

•	File specifications

Enter the file specification(s) to search here. These can be ambiguous or unambiguous. You can specify more than one by separating them with a space. To enter a specification that contains spaces, enclose it in double-quotes ("). For example:

*.* windows.* "My files.*"

A history of previously specified specifications can be recalled by pressing the drop-down button.

•	Skip text files

This option is useful if you elect to enter a file specification such as *.*, but wish to search binary files only.

•	Skip binary files

This option is useful if you elect to enter a file specification such as *.*, but wish to search text files only. Note that you cannot set both 'Skip text files' and 'Skip binary files'

•	Folders

Enter the folders to search in this box. You can specify more than one by separating them with a space. To enter a specification that contains spaces, enclose it in double-quotes ("). For example:

c:\ "c:\program files" c:\windows

If you are unsure where you want to search, press the … button to pick one from a list.

A history of previously specified folders can be recalled by pressing the drop-down button.

•	Recurse subfolders

Checking this option will cause Windows Grep to search in all subfolders below the folders specified above.

•	Count files first

Checking this option will cause Windows Grep to count the files to be searched before actually performing the search. This enables it to maintain a progress meter on the status bar during the search. Without counting first, the progress meter will be inactive. This option will slow down the search, perhaps considerably if you ask to search *.* on an entire hard disk.

The Filters page provides fine control over the files that are searched. There are two types of filters: size and date.

•	Date filter

You can choose to restrict the search to:

•	Files that are less than a specified number of days old,

•	files that are greater than a specified number of days old, or

•	files whose date is between two dates.

This works on the last modified date. Future versions of Windows Grep may support file creation and file access date filtering.

•	Size filter

You can choose to restrict the search to:

•	Files that are less than a specified number of kilobytes in size,

•	files that are greater than a specified number of kilobytes in size, or

•	files whose size falls between two given sizes.


Searching using the Command Line Interface
The Command line interface

Windows Grep supports an extensive command line interface that enables it to be run from a command line similarly to running the DOS or UNIX versions of grep utilities.

The command line takes two forms:

•	Load .PAR file and search immediately

GREP32 <.PAR filename>

This form will instruct Windows Grep to load the specified PAR file and begin the search immediately. PAR files are Windows Grep parameter files and are created when search parameters are saved using File Save. See Format of .PAR files for more information on the format and use of these. This must be a full path and filename, such as "C:\windows grep\my search.par". Remember to enclose it in double-quotes (") if it contains spaces.

•	Normal UNIX-style command line

GREP32 [<options>...] <string> <filespec> [<folder>]

Parameters enclosed in [ ] are optional.

<options> may be one of the following characters, upper or lower case, preceded by a - or /.

R	Recurse subfolders

W	Whole words only

M	Match case

C	Count Files First

S	Soundex search

To turn off a particular option, follow the character with a -.

There may be multiple options on the command line separated by spaces.

For example:

-R -W- /C-

means recurse subfolders, not whole words only and don't count first. If no options are specified, or not all five are used, the value(s) used during the last search are used.

<string>, <filespec> and <folder> behave exactly as you would expect. The <folder> is optional and if omitted the search will commence in the current directory. These parameters may contain spaces, but must be enclosed in double-quotes (") if they do. Multiple file and directory specifications are not supported in this release.

Command line examples

c:\windows> grep32 -r -C- Windows *.ini

Search all *.ini files for the string Windows in the current directory (c:\windows). Recurse subfolders, but don't count files first.

c:\windows> grep32 -r- -W Grep *.pas "c:\Delphi Work\Windows Grep"

Search all *.pas files for the string Grep in folder c:\delphi work\Windows Grep, but don't  recurse subfolders and find whole words only.


Regular expressions

The following regular expression characters are supported. Note that there a few differences between these and the characters supported by 16-bit versions of Windows Grep.

•	^ 	Circumflex - Constrain to start of line

A circumflex as the first character of the string constrains matches to start of lines.

Examples:

^Win	Match lines beginning with Win

^Grep	Match lines beginning with Grep

•	$ 	Dollar - Constrain to end of line

A dollar as the last character of the string constrains matches to end of lines.

Examples:

then$	Match lines ending with then

^end$	Match lines consisting of the single word end

•	.	Period - Match any character

A period anywhere in the string matches any single character.

Examples:

H..p	Matches Help, Hoop, Harp etc.

H.w	Matches Huw, How, Haw etc.

^Win.ers	Matches lines beginning with Winders, Winners etc.

•	* 	Asterisk - Match 0 or more

An expression followed by a asterisk matches zero or more occurrences of that expression.

Examples:

to*	Matches t, to, too etc.

00*	matches 0, 00, 000, 0000 etc.

Note that specifying a single character followed by a * will cause Windows Grep to fail.

•	+ 	Plus - Match 1 or more

An expression followed by a plus sign matches one or more occurrences of that expression.

Examples:

to+	Matches to, too etc.

10+	Matches 10, 100, 1000, 10000 etc.

/([0-9]+/)	Matches (0), (12464), (12) etc.

Note that specifying a single character followed by a + will cause Windows Grep to fail.

•	? 	Question mark	- Optionally match

An expression followed by a question mark optionally matches that expression.

Examples:

to?	Matches t and  to

10?	Matches 1 and 10

Note that specifying a single character followed by a ? will cause Windows Grep to fail.

•	()	Brackets - Expression group

Brackets can be used to group characters together prior to using a * + or ?.

Examples:

Win(dows)?	Matches Win and Windows

B(an)*a	Matches Ba, Bana and Banana

•	[ ] 	Square brackets - Character group

A string enclosed in square brackets matches any character in that string, but no others. If the first character of the string is a circumflex the expression matches any character except the characters in the string. A range of characters may be specified by two characters separated by a -. These should be given in ASCII order (A-Z, a-z, 0-9 etc.)

Examples:

{[0-9]}	Matches {0}, {4}, {5} etc.

/([0-9]+/)	Matches (100), (342), (4), (23456) etc.

H[uo]w	Matches Huw and How

Gre[^py]	Matches Green, Great etc. but not Grep, Grey etc.

[z-a]	Matches nothing

^[A-Z]	Match lines beginning with an upper-case letter

•	\ 	Backslash - Quote next character

A backslash quotes any character. This allows a search for a character that is usually a regular expression specifier.

Examples:

\$	Matches a dollar sign $

\+	Matches a +


Search results
Viewing search results

Once you have performed your search, files that have been found to contain matches are listed in the file list window.

There are now several things you can do to view the matches, or perform actions on the files:

•	View all matches in all files

Clicking on this button on the toolbar, or choosing All matches on the View menu will display all matches in all files in the results window.

•	View matches in a single file

Clicking on this button on the toolbar, choosing All matches in selected file on the View menu or clicking on a file in the file list will display matching lines from the selected file. Once a file has been displayed, the previous and next document buttons on the toolbar can be used to quickly browse files:

•	View a single file in its entirety, showing matches

Clicking on this button, or choosing Selected file on the View menu will display the selected file in its entirety, with matches highlighted.

Once a file has been displayed, the previous and next document buttons on the toolbar can be used to quickly browse files:

The previous and next match buttons can be used to locate matches within the file:

•	Launch an editor with the file loaded

Windows Grep supports the launching of external editors. By right-clicking on the file list window and selecting Edit <filename>, the editor specified in the preferences dialog (see Changing the external editor command for more information) will be launched with the file loaded.

•	Launch the program that originally created the file

By choosing Launch associated application when right-clicking on the file list window, Windows Grep will launch the application that is associated with the file currently selected. Associations normally set up automatically when loading applications. For example, if you have Borland Delphi and Netscape Navigator installed, selecting this option on a .PAS file will launch Delphi, and on a .HTM file will launch Navigator. Associations are managed with Windows Explorer.

•	Re-search the files

You can search the files listed in the file list dialog box again by clicking this button, or selecting Search files in list from the File menu. This is useful if you wish to narrow the list of files down by specifying additional criteria. A dialog similar to the normal search criteria dialog or Search Assistant (depending on whether you are in beginner or expert mode) will be shown to allow you to enter criteria for the new search.

•	Perform a replace in all files or the selected file

Once you have searched, you can perform a replacement of some or all occurrences found with another string. Clicking this button or selecting Replace from the Search menu will display the Replace Assistant if you are in beginner mode or the replace criteria dialog if you are in expert mode. For more information on replacing, see Using the Replace Assistant or Using the replace criteria dialog box.


Format and use of .PAR files

Windows Grep saves its search parameters in files with the extension .PAR. These files are in plain text and are similar to .INI files. Here's an example:

[General Search Parameters]

Search String=Grep

Match Case=False

Whole Words Only=False

Count Files First=False

Recurse Subdirectories=True

Search Mode=0

Date Filter Mode=0

Min Date=18/04/96

Max Date=18/04/96

Greater Than Days=7

Less Than Days=7

Size Filter Mode=0

Min Size=1000

Max Size=100000

Less Than Size=1000

Greater Than Size=100000

[Active File Specifications]

0=*.ini

1=*.inf

[Active Directory Specifications]

0=C:\Windows

1=C:\Program Files

2=

Each time Windows Grep loads, it looks for the file default.par. If this is found, the settings in it will be used as the basis for the first search. Pressing the start button on the toolbar will execute the search according to these parameters. Then, when Windows Grep exits, the current search settings are written back to default.par ready for the next time the program is loaded.

Searches can be saved and opened again using the toolbar buttons or menu options so that complex searches can be saved for easy recall later. .PAR files can also be specified on the command line.

If you wish to 'hand roll' your own .PAR files either by hand or by another program, bear in mind that the file does not have to have all sections or entries present. The built-in defaults will be used. These are:

[General Search Parameters]

Search String=

Match Case=False

Whole Words Only=False

Count Files First=True

Recurse Subdirectories=True

Search Mode=0

Date Filter Mode=0

Min Date=<today's date>

Max Date=<today's date>

Greater Than Days=7

Less Than Days=7

Size Filter Mode=0

Min Size=1000

Max Size=100000

Less Than Size=1000

Greater Than Size=100000

Note that this default file will not result in a successful search: You will need to add at least one entry in the active file and active directory specification sections and specify a search string.

So, the minimum usable .PAR file is:

[General Search Parameters]

Search String=<string>

[Active File Specifications]

0=<filespec>

[Active Directory Specifications]

0=<dir>


Using with Novell networks and Windows NT
Using with Novell networks and Windows NT 3.51

Some Novell networks do not support long filenames. If yours does not, errors will occur if you try to perform replacements on files residing on your server. This is because by default, Windows Grep will append .new  or .bak to the original file name which results in a longer than 8+3 filename.

To force the use of short filenames, check the box on the Preferences dialog, Compatibility tab.

Windows NT 3.51 does not support the retrieval of the file type text that is displayed in the file list. This column will be blank when running Windows Grep under this platform. In addition, icons displayed to the left of filenames may also be blank. There are also some minor cosmetic problems, which I am currently unable to correct.

Windows NT 4.00 supports file types, and Windows Grep correctly displays it.


Uninstalling Windows Grep

Windows Grep can be uninstalled completely from your hard disk if you decide not to continue using it.

To do this, click on the ‘Uninstall Windows Grep’ icon in the Windows Grep group, or

Start Control Panel

Click on the Add/Remove Programs icon

Find Windows Grep in the list at the bottom of the list and press the Add/Remove button.

The uninstaller will be run and all files added by the installation will be removed. You will then need to manually delete the directory you installed Windows Grep in, because it may still contain .PAR files.


Notes on searching binary files

Windows Grep can search binary files, and most of the time it does a pretty good job. However it is not perfect, so the following discussion on how it works may be of interest.

Files to be searched are first examined to see whether they are text (ASCII files with CR/LF at the end of each line) or binary (all other files). A block of the file is read in, and if it is found to contain any non-printing characters such as 0x00 to 0x08 etc. the file is taken to be binary. In addition, if the block does not contain any carriage returns or line feeds it is also assumed to be binary.

When binary files searched, they are read in 256 bytes at a time. Then, non-printing characters are stripped out to leave a string that is less than 256 bytes but contains only proper characters, punctuation, accented characters and so on. It is this string that is then searched, and displayed in the results window. This accounts for the differing lengths of lines shown when matches are found.

This method has one flaw. If the word you are searching for occurs on a 256-byte boundary, Windows Grep will not find it. I hope one day to fix this, but for now be aware of it!


Configuring the file list
Changing the way the file list looks

The appearance of file list window can be modified in the same ways that other Explorer-style windows in other applications can be.

The file list can be viewed in 4 different ways. To change the view, right click on the file list window and select the appropriate option from the View sub-menu.

•	Large

Display the list using large icons

•	Small

Display the list using small icons

•	List

Display a multi-column list, with small icons

•	Details

Display a tabular list of files, showing search statistics, file sizes, dates and so on. This is the most useful and the default.

When in details view, the widths of the columns can be adjusted with the mouse. Widths are saved between sessions. To remove a column completely, adjust its width to 0.

Columns can also be moved from one position to another by dragging and dropping the header. The positions are not currently saved.


Configuring the results window
Changing the way the results window looks

The following attributes can be changed in the results window. To change them, right-click on the results window and select the appropriate option from the menu.

•	Match color

Matches are shown in a different color to non-matching text. This color can be changed using the standard Windows colour-picker. The background and unmatching text colors are changed from the Windows Control Panel. The default is green.

•	Font

The font used in the window can be chosen from any currently installed font using the standard Windows font-picker.

•	Line numbers

Line numbers can be toggled on and off by selecting the Line numbers option on the menu.

•	Title

Similarly, a title can be toggled on and off using the Title menu items. It is often useful to add a title to the window before printing - the printed output is identical to the window contents.


Changing the external editor command

Windows Grep can launch external editors when Edit <filename> is selected from the menu available when right-clicking on the file list window.

By default, notepad is used. To change this to something more powerful, select Preferences from the Options menu, and pick the Editor tab. You can now specify the editor command to execute.

The editor command line takes the following form:

<full path and filename of editor>  [$F] [$L] [$G]

The $F will be substituted with the name of the file that is currently selected in the file list window when the Edit command is chosen.

The $L will pass the number of the line that contains the first match in the file. Future versions will support the passing of the line number clicked on.

$G will pass the search string

The parameters may be in upper or lower case and are optional. However leaving off $F will probably render the command useless - the editor will be launched with no file loaded.

Examples:

notepad.exe $f	(the default)

Launch Notepad and load the selected file

"c:\Program Files\MyEdit.exe" /file=$F /line=$L

Launch MyEdit.exe, and pass filename and line number on the command line.

Future versions of 32 bit Windows Grep may support other editors using DDE or some other protocol. If you want me to consider adding support for your preferred editor, please ask!


Controlling names of files created during replacements
Controlling the names of files created during replacements

By default Windows Grep creates names like this when replacing:

MyFile.txt.BAK

MyFile.txt.NEW

If you would prefer the existing extension to be dropped, and the new one appended, select Preferences from the Options menu and select the Compatibility tab.

Checking the ‘8+3’ box will force short filenames to be used.

If you are using a Novell network, you may need this option set if your server does not support long filenames.


Replacing using the Replace Assistant
Using the Replace Assistant

In addition to searching, this version of Windows Grep can also perform string replacements. This much requested feature can be extremely useful for globally changing variable names in a large number of source code files, for example, or modifying HTML tags on web pages.

Note that you can only perform replacements in plain ASCII text files.

The replace assistant will guide you through the process of entering the information needed to perform a replace. It will ask the following questions:

•	What do you want to replace the string just located with?

The Replace Assistant will show you the string that has just been located, then allow you to enter the string you want to replace it with. This can be the same or different in length to the original string and can even be left blank to have the searched-for string removed from the files. Note that in this release, regular expressions are not recognised in replace strings - they will be inserted into the file verbatim.

•	What files do you want to replace in?

If you had a file selected in the file list window when you invoked the Replace Assistant, you will have the choice of either replacing in the single file highlighted, or in all files found. Otherwise, the replace will act on all files in the file list.

•	Do you want to change the original files?

You can elect to change the original files, or leave the originals intact and save the changes in a different file. If you choose to change original files, a backup will be created called <original filename>.bak. If you choose to make copies, changes will be saved in <original filename>.new. So even if you change the originals but make a mistake you can get back the unmodified files.

•	Do you want to confirm each replacement?

You have the choice of having Windows Grep make changes to the file(s) without further intervention, or you can get it to show you every replacement it is about to do so that you can confirm that you want the replacement to go ahead. If you choose the latter, a dialog box will be displayed showing you the line it is about to modify before and after the replacement.

After you have finished replacing, a replace report will be output to the results window which you can save or print. This will show which files were modified and the number of modifications made to each.

Take care when replacing!


Replacing using the replace dialog box
Using the replace criteria dialog box

To replace using the replace criteria dialog box, set the following options:

•	Replacement string

Enter the string you want to replace the string just found with. This can be the same or different in length to the original string and can even be left blank to have the searched-for string removed from the files. Note that in this release, regular expressions are not recognised in replace strings - they will be inserted into the file verbatim.

•	Replace in all files/in selected file?

If you had a file selected in the file list window when you invoked the replace criteria dialog box, you will have the choice of either replacing in the single file highlighted, or in all files found. Otherwise, the replace will act on all files in the file list.

•	Make changes to the original file?

You can elect to change the original files, or leave the originals intact and save the changes in a different file. If you choose to change original files, a backup will be created called <original filename>.bak. If you choose to make copies, changes will be saved in <original filename>.new. So even if you change the originals but make a mistake you can get back the unmodified files.

•	Confirm each replacement?

You have the choice of having Windows Grep make changes to the file(s) without further intervention, or you can get it to show you every replacement it is about to do so that you can confirm that you want the replacement to go ahead. If you choose the latter, a dialog box will be displayed showing you the line it is about to modify before and after the replacement.

After you have finished replacing, a replace report will be output to the results window which you can save or print. This will show which files were modified and the number of modifications made to each.

Take care when replacing!


Take care while replacing!

Windows Grep has been extensively tested to ensure replacing is bug-free. However I cannot be held responsible for damage the program may inadvertently do to your files.

Replacing is always done safely. Even if you elect to make changes to the original files, a backup is created first. Bear in mind however that if you do two replacements in a row, the first backup will be lost forever.

You have been warned…


Why bother to register?
Why register?

Windows Grep is distributed as Shareware. It is not free or public domain. This means you may copy and distribute it freely but should you find it useful and use it beyond an initial evaluation period of 30 days you are both legally and morally obliged to pay the license fee. See the release notes file included in the distribution archive/on the distribution disk for more information.

When you register this program, you will encourage me to continue to support and develop it and create more high quality Shareware programs.

Registration brings the following benefits:

•	A registration code that will 'brand' your copy so that your name or your organisation's name appears in the About box.

•	Lifetime support by eMail.

•	The reminder dialog displayed on exit will no longer appear.

To keep costs down, I will not normally send you anything other than the registration code.


Registration information

The single user license fee is £15.00 or US$30.

Site license prices are open to negotiation and depend on the prevailing exchange rate. The following table is for guide only. Please enquire for a quotation before purchasing.

Users	Price/US$	Total

10	$20 ea.	$200

20	$17 ea.	$340

30	$15 ea.	$450

40	$12 ea.	$480

50	$10 ea.	$500

Unlimited single site 	$600

There are two ways to register this program:

•	If you have access to CompuServe, you can register on-line using SWREG. Simply type GO SWREG and follow the instructions. The license fee will be charged to your CompuServe account, and I will inform you of your registration number by e-mail, usually within 24 hours.

The SWREG ID number is 14565

•	By Mail. Cash or checks/cheques can be accepted in any major currency, equivalent in value to US$30 per copy. Sterling Eurocheques are preferred from European countries that supply them. Please fill out a registration form and send to me at the address given. Purchase orders from corporates are also acceptable.

Upgrading from 16 bit versions

The upgrade fee for registered users of Windows Grep 1.x is $10 or £5. Please use the Upgrade Registration form to upgrade, or CompuServe SWREG ID 14566 (US$10). If you use the latter, please eMail me your registration number for v1.x, which can be found in wgrep.ini, in your Windows directory.


Support and updates

I would very much like to inform all registered users when I release new versions, but there are now so many that I am unable to do so. For this reason, latest information about my Shareware products is available on my World Wide Web page:

http://www.pncl.co.uk/~huw/homepage.html

The current version will always be available from the following sources:

From links on my homepage,  URL above

CompuServe, use PCFF, search for WINGREP to locate

The wingrep conference on CIX (The UK's premier conferencing system)

If you do not have access to any of the above, please send a diskette and suitable mailer to me at the address below.

I would also be pleased to receive any comments, bug reports or suggestions for future releases. I may be contacted at the addresses below:

Internet: 	huwmill@cix.compulink.co.uk

CompuServe: 	100016,3452 or hmillington@compuserve.com

Snail:

Huw Millington

40 Farm Close

East Grinstead

W. Sussex

RH19 3QG

UK


Registration form

Print this form and send it with your remittance to:

Huw Millington

40 Farm Close

East Grinstead

W. Sussex

RH19 3QG

UK

Windows Grep v2.0 Registration Form.

Date: _________________

I wish to register ____ copies of Windows Grep.

I am registering from:

USA and enclose a check for $US______	($30 per copy)

UK and enclose a cheque/PO for £______	(£15 per copy)

Europe and enclose a Eurocheque for £______	(£15 per copy)

NOTE: I am unable to acccept EuroCheques made out in US$.

Another country and enclose a check drawn on a local bank for ______

(equivalent in value to $US 30 per copy)

Name(s)	_______________________________________________

(To appear in about box, continue on separate sheet if necessary)

Company	_______________________________________________

Address	_______________________________________________

_____________________________________________________________

_____________________________________________________________

Code	___________________

Country	___________________

E-Mail	_______________________________________________

(Block capitals please)

Where did you obtain Windows Grep from? _____________________________

Primary use of Windows Grep: ________________________________________

Do you have access to the WWW: Yes/no (Delete as appropiate)

Comments:


Upgrade registration form

Print this form and send it with your remittance to:

Huw Millington

40 Farm Close

East Grinstead

W. Sussex

RH19 3QG

UK

Windows Grep 1.x to 2.0 Upgrade Registration Form.

Date: _________________

I wish to upgrade ____ copies of Windows Grep.

I am registering from:

USA and enclose a check for $US______	($10 per copy)

UK and enclose a cheque/PO for £______	(£5 per copy)

Europe and enclose a Eurocheque for £______	(£5 per copy)

NOTE: I am unable to acccept EuroCheques made out in US$.

Another country and enclose a check drawn on a local bank for ______

(equivalent in value to $US 10 per copy)

Name(s)	_______________________________________________

(That appears in the about box)

Number(s)	_______________________________________________

(Registration number for 1.x. Can be found in WGREP.INI

in your Windows subdirectory)

Company	_______________________________________________

Address	_______________________________________________

_____________________________________________________________

_____________________________________________________________

Code	___________________

Country	___________________

E-Mail	_______________________________________________

(Block capitals please)

Where did you obtain Windows Grep from? _____________________________

Primary use of Windows Grep: ________________________________________

Do you have access to the WWW: Yes/no (Delete as appropiate)

Comments:


What's new?
What's new in version 2.0

Everything! The following notes may be of interest to you if you have used Windows Grep 1.x.

•	Native 32 bit executable.

16 bit versions of Windows Grep were written in Turbo or Borland Pascal. When Delphi 1.0 was released and Borland scrapped the Object Windows Library, it became apparent that a complete rewrite would be needed if the program was to make it to 32 bits. Shortly after the release of Windows Grep 1.6 in January 1995, I bit the bullet and started work on producing a Delphi version, using Delphi 1.0, the 16 bit release. By the time Delphi 2.0 was released in March 1996, the program was 90% complete. All that was needed was to fully 'Windows 95-ise' the interface and take advantage of other 32-bit features. Full credit to Borland for making the transition as painless as possible.

•	New user interface

As a complete rewrite was required, I took the opportunity of reviewing version 1.6's user interface and looking for ways of improving it. It was apparent that the MDI interface was going the way of the Dodo in Windows 95 programs, so the first decision was to abandon it and look for alternatives. I played with multiple-window interfaces like Visual Basic and Delphi, but eventually arrived at the multi-pane main window design, which was both easier to use and to program. I also wanted to take advantage of as many Windows 95 features as possible. There are still some improvements in this area to be made, such as drag-drop to/from the Explorer shell, but hopefully these will come with time.

•	More robust and no limits!

Thanks to Delphi's excellent exception handling, you should find that Windows Grep falls over far less frequently than the 16 bit versions. There may still be some rogue file types that trip it up though - if you find any do let me know!

Thanks mainly to the RichEdit text control, there is now no limit to the size of the files that can be viewed in the results window.

•	New regular expression parser DLL

The regular expression parsing DLL I am now using is different to the one used in the 16 bit releases. One advantage this has is that it allows search strings containing extended ASCII characters to be specified, such as those found in foreign character sets. The regular expressions supported are not as extensive as before, however.


Features unavailable
Features not yet available

I have tried to include as many features found in the 16 bit version in this initial 32 bit release as possible, but there are still a few holes. I hope that, with your support, I am able to address them all in due course.

Here's a few that come to mind:

•	Zip file searching

Look out for this in v2.1!

•	Drag-drop to/from other applications

•	File manager extension

When I have found out how to hook into Explorer I will do so.


Printing

Search results can be printed with ease. When the print button on the toolbar is clicked on, or Print on the File menu is selected, the exact contents of the results window will be sent to the printer.

You may therefore wish to set the font, color, title and line number settings for the result window before printing.


Opening and saving

The save button (or Save As… on the File menu) has two uses:

•	Saving the search parameters

Search parameters can be saved to disk to allow complex searches to be set up, saved, then recalled for later use. These are saved in files with the extension .PAR. See Format and use of .PAR files for more information on their format and usage.

Once you have set up your search parameters and performed the search, click on the save button to save them to disk. Ensure that the Save as type box on the save dialog is set to Search parameters (.PAR).

•	Saving the contents of the results window to disk

The exact contents of the search results window can be saved to disk in either Rich Text Format (RTF) or plain text. Display what you want to save in the results window, click on the save button, then ensure that Ensure that the Save as type box on the save dialog is set to Results in rich text format (.RTF). or Results in plain text (.TXT) as appropriate.

The open button on the toolbar (or Open… on the File menu) will allow search parameter files previously saved as described above to be reloaded.

Once loaded, to execute the saved search immediately click on the [image]  button

To modify the parameters before searching, click on the  [image] button